package com.dingding.order.facade;

import org.apache.log4j.Logger;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.dingding.common.core.beans.Userordert;
import com.dingding.order.core.pay.dao.IOrderPayDao;
import com.dingding.order.dto.grab.PushCompetitiveOrder;
import com.dingding.order.service.IOrderPayFacade;

/**
 * @Description: 订单支付接口
 * @author fengshuonan
 * @date 2016年6月7日 上午10:27:27
 */
@Component("orderPayFacade")
public class OrderPayFacade implements IOrderPayFacade {

	private Logger log = Logger.getLogger(this.getClass());
	
	@Autowired
	private IOrderPayDao orderPayDao;  //订单支付dao
	
	
	/**
	 * @Description:获取订单详情（临时表中）
	 * @author fengshuonan
	 * @return Userordert
	 */
	@Override
	public Userordert getUserOrderT(String orderId) {
		
		// 添加订单Id作为查询条件
		Criterion criterion = Restrictions.eq("oid", orderId);

		// 根据订单Id查询订单信息
		Userordert userordert = null;

		try {
			userordert = this.orderPayDao.queryCriteriaUnResult(criterion);
		} catch (Exception e) {
			log.error("根据订单Id获取订单信息时出现异常  类：" + this.getClass() + " getUserOrderT()", e);
			return null;
		}

		return userordert;
	}

	
	/**
	 * @Description:乘客扣款
	 * @author fengshuonan
	 * @return PushCompetitiveOrder
	 */
	@Override
	public PushCompetitiveOrder passengerDebit(Userordert userordert, PushCompetitiveOrder pushCompetitiveOrder) {
		
		
		
		return null;
	}

}
